package com.wn.inventory.redis;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ author     ：NST
 * @ date       ：Created in 2022/10/19 20:31
 * @ description： redisson配置类
 * @ modified By：
 * @ version:
 */
@Configuration
public class RedissonConfiguration {

    //配置redisson 用于分布式锁
    @Bean
    public RedissonClient redissonClient() {
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.12.202:6379");
        config.useSingleServer().setPassword("ningsongtao");
        return Redisson.create(config);
    }
}
